<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/3/17
 * Time: 14:18
 */

echo "<title>10-6 字符串的截取</title>";
echo "<p style='text-align: center'><a href=\"index.php\"><font size=\"4\">目录</font></a></p>";
header("Content-type: text/html; charset=utf-8");
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />";

//截取字符串
$str = 'hello world';
echo substr($str,6,5);
echo '<br/>';

//中文字符串的截取函数
$str = '我爱你，中国';

//截取中国两个字
echo mb_substr($str,4,2,'utf8');

